import request from '@/utils/request'

// 获取页面数据
export function getRegPlanningDesignDetail (projectId) {
  const url = `/renovation/planningDesign/notify/detail?projectId=${projectId}`;
  return request({
    url: url,
    method: 'post'
  })
}

// 申请规划设计》》保存
export function saveRegPlanningByCountry (data) {
  const url = `/renovation/planningDesign/apply/data/save`;
  return request({
    url: url,
    method: 'post',
    json: data
  })
}

// /renovation/examineOpinion/list 获取审查流程列表
export function examineOpinionList(data) {
  return request({
    url: '/renovation/examineOpinion/list',
    method: 'post',
    formData:data
  })
}
// export function examineOpinionList ({groupId, projectId}) {
//   const url = `/renovation/examineOpinion/list`;
//   return request({
//     url: url,
//     method: 'post',
//     formData:data
//   })
// }

// 获取个人信息
export function getPersonMsg(id) {
  return request({
    url: `/pc/system/pc_user/4_find_by_id?id=${id}`,
    method: 'post'
  })
}

// 添加审查意见
export function addReviewOpinion(data) {
  return request({
    url: '/renovation/examineOpinion/add',
    method: 'post',
    formData:data
  })
}

// 下载文件
export function downloadFile(id) {

  const url = `/pc/file/download?id=${id}`
  return request({
    url: url,
    method: 'get'
  })
}

// 申请规划设计通知》》保存
export function planningDesignNotifySave(data) {
  let url = `/renovation/planningDesign/notify/save`
  return request({
    url: url,
    method: 'post',
    json: data
  })
}

// 获取
export function getNotifyDetail(projectId) {
  const url = `/renovation/planningDesign/notify/detail?projectId=${projectId}`
  return request({
    url: url,
    method: 'post'
  })
}

//区县中心意见保存
export function saveCheckDistrictData(data) {
  return request({
    url: '/renovation/planningDesign/apply/upload/save',
    method: 'POST',
    json: data
  })
}


// 处理参数为url query方式
function makeQueryToPrams(url, data) {
  let link = url
  if(link.indexOf('?') == -1) {
    link += '?'
  }
  for (let i in data) {
    link += i + '=' + data[i] + '&'
  }
  return link
}



